<script type="text/javascript">
$(document).ready(function() 
    { 
        $("#courses-sortable").tablesorter({widgets: ['zebra']}); 
    } 
); 
</script>
<div id="sortTables">
		<table id="courses-sortable" class="tablesorter">
		<thead>
			<tr>
				<th scope="col">Kurskod</th>
				<th scope="col">Kursnamn</th>
				<th scope="col">Sök tent</th>
				<th scope="col">Utanför<br/>studieplan</th>
				<th scope="col">Stryk</th>
			</tr>
		</thead>
		<tbody>
		
<?php foreach ($course_list as $course) { ?>
<?php if (strlen($course['course_code']) > 0) { ?>
			<tr>
				<td><?php echo $course['course_code']; ?></td>
				<td><?php
					echo "<a href=\"?action=getCourse&course={$course['course_code']}\">";
					echo "{$course['course_name']}</a>";
				?></td>
				<td><?php echo "<a href=\"?action=searchExam&course={$course['course_code']}\"><img alt=\"Sök Tent\" src=\"css/var_plan/icons/find.png\"></a>"; ?></td>
				<td><?php if ($course['course_extra']) echo "<img alt=\"Ja\" src=\"css/var_plan/icons/error.png\" border=\"0\">"; ?></td>
				<td><?php
					$page = (int) $course['course_extra'];
					echo "<a href=\"?action=removeCourse&page={$page}&row={$course['course_row']}\" class=\"remove\"><img alt=\"[Ta bort]\" src=\"css/var_plan/icons/cross.png\"></a>";
				?></td>
			</tr>
<?php } ?>
<?php } ?>
		</tbody>
		</table>
</div>
